import 'package:finance_app/generated/json/base/json_convert_content.dart';
import 'package:finance_app/generated/json/base/json_field.dart';
import 'package:finance_app/src/entities/ocr_attachment_entity.dart';
import 'package:finance_app/src/entities/payment_entity.dart';

class FixedAssetEntity with JsonConvert<FixedAssetEntity> {
  @JSONField(name: "date_type")
  String dateType;
  int id;
  @JSONField(name: "company_id")
  int companyId;
  @JSONField(name: "category_id")
  int categoryId;
  String name;
  String number;
  @JSONField(name: "ref_number")
  String refNumber;
  String type;
  @JSONField(name: "type_id")
  int typeId;
  @JSONField(name: "purchased_at")
  String purchasedAt;
  String category;
  @JSONField(name: "currency_code")
  String currencyCode;
  String price;
  num total;
  @JSONField(name: "book_value_after")
  dynamic bookValueAfter;
  @JSONField(name: "book_value")
  String bookValue;
  @JSONField(name: "depreciation_type")
  String depreciationType;
  @JSONField(name: "depreciation_total")
  String depreciationTotal;
  int lifespan;
  @JSONField(name: "lifespan_used")
  int lifespanUsed;
  String status;
  @JSONField(name: "created_at")
  String createdAt;
  @JSONField(name: "updated_at")
  String updatedAt;
  @JSONField(name: "asset_depreciations")
  List<AssetDepreciation> assetDepreciations;
  List<OcrAttachmentEntity> attachments; //depreciated
  @JSONField(name: "attachments_info")
  List<OcrAttachmentEntity> attachmentsInfo;
  String notes;

  @JSONField(name: "sell_at")
  String sellAt;
  @JSONField(name: "sell_currency_code")
  dynamic sellCurrencyCode;
  @JSONField(name: "sell_price")
  String sellPrice;
  @JSONField(name: "sold_attachments_info")
  List<OcrAttachmentEntity> soldAttachmentsInfo;

  @JSONField(name: "disposed_at")
  String disposedAt;
  @JSONField(name: "disposed_attachments_info")
  List<OcrAttachmentEntity> disposedAttachmentsInfo;

  List<PaymentEntity> payments;
}

class AssetDepreciation with JsonConvert<AssetDepreciation> {
  @JSONField(name: "date_type")
  String dateType;
  int id;
  @JSONField(name: "company_id")
  String companyId;
  @JSONField(name: "asset_id")
  String assetId;
  @JSONField(name: "issued_at")
  String issuedAt;
  @JSONField(name: "currency_code")
  String currencyCode;
  num total;
  String status;
  @JSONField(name: "created_at")
  String createdAt;
  @JSONField(name: "updated_at")
  String updatedAt;
  @JSONField(name: "start_date")
  String startDate;
  @JSONField(name: "end_date")
  String endDate;
}
